The present invention relates to computer programming and, in particular, to a method and system for matching the dimensions of the text layer of a graphics terminal emulation session with those of the graphics layer of the same session, allowing images transmitted by a host computing system to be scaled while retaining correct proportions.
A terminal emulator allows an intelligent computing device such as a personal computer (xe2x80x9cPCxe2x80x9d) to mimic or emulate a fixed-function terminal""s communications with a mainframe host computer or a host minicomputer. As its name implies, a fixed-function terminal may perform only a limited set of specific tasks related to the display and manipulation of mainframe or minicomputer data. Terminal emulation software makes a general-purpose computing device such as a Windows PC appear to the host computer as a particular type of terminal with which the host may communicate using its native data stream. For example, IBM computers may communicate with 3270 terminals in an IBM System Network Architecture (xe2x80x9cSNAxe2x80x9d) network. In an emulation environment, the host computer exchanges data and commands with the client in accordance with the appropriate characteristics of the emulated terminal.
Thus, a typical terminal emulator receives and sends data and commands appropriate to a particular terminal. For example, character mode terminals, also known as text mode terminals or alphanumeric mode terminals, display letters, numbers, and other text characters but not graphical images or WYSIWYG (xe2x80x9cwhat-you-see-is-what-you-getxe2x80x9d) character formatting, such as proportional spacing, italics and superscript. Many graphics terminals, such as the IBM 3000 series, display text in fixed matrices of uniform columns and rows. For example, the two standard matrices (columns by rows) supported by the IBM 3179G, 3192G and 3472G graphics terminals are respectively 80-by-24 (Model 2) and 80-by-32 (Model 3), with each matrix display coordinate expressed in terms of a specific column and row. A character cell located at each matrix display coordinate is a rectangular block of pixels that represents the space in which a given character is drawn on the screen.
Emulation systems have been developed that emulate fixed-function terminals on more modem PC-based computing systems and provide an interface with the host applications. Many of these emulation systems display the data produced from the host session in a graphical format on the PC. The PC""s graphical display may be produced within xe2x80x9cwindowsxe2x80x9d by a graphical user interface (xe2x80x9cGUIxe2x80x9d) program. A GUI window typically has greater flexibility in its display than a fixed-function terminal. Accordingly, the display of an emulated terminal session typically does not have the rich characteristics of other more common GUI-based application programs. Emulation of graphics terminals such as the IBM 3472G is potentially the most restrictive in a GUI environment because the mainframe graphics application scales graphical data according to display characteristics reported by the emulator at the beginning of the session. The emulator must reconcile differences between the reported characteristics and the actual physical characteristics of the PC""s display subsystem.
FIG. 1 illustrates a conventional mainframe graphics terminal emulation environment. A host mainframe computer 100 communicates with a client computer 102 through a terminal emulator 101. A communications unit 103 in the terminal emulator 101 sends data 107 to the host mainframe 100. The host mainframe 100 returns data 106 to the communications unit 103. Some of the data returned by the host mainframe 100 to the communications unit 103 includes graphical data which the communications unit 103 forwards to a host graphics emulator 104. The host graphics emulator performs some formatting of the emulation session data before forwarding this data to a user interface 105 suitable for producing display data in a format required by the client computer 102. The user interface 105 provides the display data 108 to a display device 109 which then depicts a graphics display window 110 that contains the emulated session data.
FIG. 2A illustrates a conventional text-mode emulation display session as depicted within the graphics display window 110. The display device 109 displays an emulated session 201 within a graphics border 202 of the graphics display window 110. Because the host mainframe 100 produces the emulated session 201, according to its predetermined format, and the client computer 102 produces the graphics border 202 according to the characteristics of the display device 110, the emulated session data 201 may not necessarily align with the graphics border 202. For example, as shown in FIG. 2A, a great deal of unused space exists between the graphics border 202 and the emulation session data 201. Many emulation system customers would prefer terminal emulation session displays that utilize more of the available area within the GUI window than that shown in FIG. 2A.
FIG. 2B illustrates a conventional graphics-mode emulation display session as depicted within the graphics display window 110. The display device 109 displays an emulated session 201b within the graphics border 202 of the graphics display window 110. Because the host mainframe 100 produces the emulated session 201b, according to its predetermined format, and the client computer 102 produces the graphics border 202 according to the characteristics of the display device 110, the emulated session 201b may not necessarily align with the graphics border 202. For example, as shown in FIG. 2B, a great deal of unused space exists between the graphics border 202 and the emulation session 201b. Many emulation system customers would prefer terminal emulation session displays that utilize more of the available area within the GUI window than that shown in FIG. 2B.
Embodiments of the present invention provide a method and system for displaying in real time emulated characters produced by a host computing system in an arbitrarily sized graphics display window controlled by a client computing system. Displayed characters minimize the unused graphical user interface (xe2x80x9cGUIxe2x80x9d) window space while still maintaining an appropriate aspect ratio for mainframe graphics images.
The mainframe graphics emulator adjusts the dimensions of the graphics layer to minimize unused GUI window space while maintaining correct aspect ratio. A character spacing unit invokes a font-sizing procedure that scales the emulated characters in a manner appropriate for the dimensions of the graphics layer, according to an embodiment of the invention. The character spacing unit centers the character text within the bounds of the graphics layer. The character spacing unit next synthesizes additional font sizes by adding pixels to the width and/or height of the basic character cell dimensions in order to further enlarge the characters and decrease the unused area within the bounds of the graphics layer without varying the emulated characters"" spacing. Finally, the character spacing unit distributes any remaining area within the bounds of the graphics layer throughout the rows and columns of text using a linear distribution procedure. The linear distribution procedure allows the character image to occupy the graphics display window with a natural appearance. The character spacing unit uses the linear distribution procedure to distribute characters both horizontally and vertically in the graphics display window generated by the client computer. The character spacing unit enables the graphics emulator to scale images, maintaining correct aspect ratio, while not rigidly adhering to a uniform spacing of character rows and columns.
According to a method of the invention, emulated characters are scaled in a manner appropriate for the size of the graphics display window. The scaled character text is then centered within the graphics display window. Additional font sizes are then synthesized by adding pixels to the width and/or height of the basic character cell dimensions in order to utilize a larger area within the graphics display window without varying the character spacing. Any remaining area within the graphics display window is then distributed throughout the rows and columns of text using a linear distribution procedure. The Bresenham line drawing algorithm serves as the linear distribution procedure, according to an embodiment of the invention.